| Use a Data Environment to Connect to a Database 1. Select Project, Add Data Environment from the Visual Basic menu. 2. Click DataEnvironment1. 3. Set the Name property to deEmployee in the Properties window. 4. Click Connection1. 5. Set the Name property to cnEmp in the Properties window. 6. Right-click the cnEmp object and choose Properties from the menu. 7. Youll now see a dialog box called Data Link Properties from which you can choose a provider and create a connection to a database (see Figure 27.2). 8. Select either Microsoft Jet 3.51 OLE DB Provider or Microsoft OLE DB Provider for ODBC Drivers and then click the Connection tab. |
| |
| |
|
|
|
|
Figure 27.2
The Data Link Properties dialog box. |
|
|
|
|
 | You have created a new data environment and linked that to an Access database. You will now be able to use that data environment instead of creating an ADO connection and Recordset. |